package edu.hqu.deepspace.service;

import edu.hqu.deepspace.dao.ProductMapper;
import edu.hqu.deepspace.pojo.Product;

import java.util.List;

public class ProductServiceImpl implements  ProductService {
    private ProductMapper productMapper;

    public void setProductMapper(ProductMapper productMapper) {
        this.productMapper = productMapper;
    }

    @Override
    public int addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public int deleteProductById(int id) {
        return productMapper.deleteProductById(id);
    }

    @Override
    public int updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public Product queryProductById(int id) {
        return productMapper.queryProductById(id);
    }

    @Override
    public List<Product> queryAllProduct() {
        return productMapper.queryAllProduct();
    }
}
